package com.xiaoye.qbproject.vo.relation;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @author : ChenYao
 * @version : 1.0
 * @description :
 * @create : 2025-01-06 12:28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Node implements java.io.Serializable {

    /**
     * 节点ID
     */
    private String id;
    /**
     * 节点名称
     */
    private String text;
    /**
     * 节点类型
     */
    private RelationVo.NodeTypeEnum type;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Node node = (Node) o;
        return Objects.equals(id, node.id) && Objects.equals(text, node.text) && type == node.type;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, text, type);
    }
}
